package org.example.demo_test;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.apache.thrift.transport.layered.TFramedTransport;
import org.example.demo.model.addStoreReq;
import org.example.demo.model.deleteStoreReq;
import org.example.demo.model.getStoreReq;
import org.example.demo.storeInterface;

import java.util.List;

public class client {
    public static void main(String[] args) throws TException {
        TTransport transport = new TFramedTransport(new TSocket("localhost", 9000), 600);
        TProtocol protocol = new TCompactProtocol(transport);
        storeInterface.Client client = new storeInterface.Client(protocol);
        deleteStoreReq deleteStoreReq = new deleteStoreReq(1);
        transport.open();
        // 接口方法
        client.deleteStore(deleteStoreReq);
        List<getStoreReq> store = client.getStore(1, "333");
        System.out.println(store);
        return ;
    }
}
